package com.cn.studey.listeningmessage.rocketmqmessage;

import com.cn.studey.config.RocketMqConsumerConfiguration;
import org.apache.rocketmq.client.exception.MQClientException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

/**
 * @author mjy
 * @date 2021/12/20
 * @description
 */
public class ListenMqMessage extends RocketMqConsumerConfiguration implements ApplicationRunner {


    Logger log = LoggerFactory.getLogger(ListenMqMessage.class);

    @Override
    public void run(ApplicationArguments args) throws Exception {
        try {
            log.info("开始创建客户端消息");
            super.createMqConsumer();
        } catch (MQClientException e) {
            log.info("创建客户端消息异常");
            e.printStackTrace();
        }
        log.info("开始创建客户端消息完成");
    }

}
